<% layout("/inc/layout_page.html"){ %>

<form action="${BASE}/admin/cms/CmsSiteConfig/save" id="form_save" method="post">
<input type="hidden" id="id" name="id" value="${obj.id}">
<input type="hidden" id="sid" name="sid" value="${obj.sid}">
<div class="box">
  <div class="box-body">
    <div class="nav-tabs-custom">
      <ul class="nav nav-tabs">
        <li class="active"><a href="#tab_1" data-toggle="tab">网站信息</a></li>
        <li><a href="#tab_2" data-toggle="tab">SEO设置</a></li>
        <li class="pull-right"><button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> 保存</button></li>
      </ul>
      <div class="tab-content">
        <div class="tab-pane active" id="tab_1">
          <table class="table tform table-bordered">
		      <tr>
		        <th width="30%"><label for="siteTitle"><i class="required">*</i>站点title：</label></th>
		        <td><input id="siteTitle" name="siteTitle" value="${obj.siteTitle}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="siteName"><i class="required">*</i>站点名称：</label></th>
		        <td><input id="siteName" name="siteName" value="${obj.siteName}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="siteCopy">站点版权信息：</label></th>
		        <td><input id="siteCopy" name="siteCopy" value="${obj.siteCopy}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="siteIcp">站点ICP：</label></th>
		        <td><input id="siteIcp" name="siteIcp" value="${obj.siteIcp}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="logoUrl">logoUrl：</label></th>
		        <td><input id="logoUrl" name="logoUrl" value="${obj.logoUrl}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="remarks">备注信息：</label></th>
		        <td>
		          <textarea id="remarks" name="remarks" cols="" rows="" class="form-control"  placeholder="备注信息...255个字符以内" dragonfly="true" onKeyUp="textarealength(this,255)">${obj.remarks}</textarea>
		          <p class="textarea-numberbar"><em class="textarea-length">0</em>/255</p>
		        </td>
		      </tr>
          </table>
        </div>
        <div class="tab-pane" id="tab_2">
		  <table class="table tform table-bordered">
		      <tr>
		        <th width="30%"><label for="keywords">keywords：</label></th>
		        <td><input id="keywords" name="keywords" value="${obj.keywords}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="description">description：</label></th>
		        <td><input id="description" name="description" value="${obj.description}" type="text" class="form-control"></td>
		      </tr>
		      <tr>
		        <th><label for="summary">站点描述：</label></th>
		        <td><input id="summary" name="summary" value="${obj.summary}" type="text" class="form-control"></td>
		      </tr>
		  </table>
        </div>
      </div>
    </div>
  </div>
  <div class="box-footer">
    <div class="box-tools pull-right">
      <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> 保存</button>
    </div>
  </div>
</div>
</form>

<script type="text/javascript">
$(function(){
	
	$("#form_save").validate({
		errorPlacement: function(error, element) {
			error.appendTo(element.parent());
		},
		submitHandler : function(form) {
			layer.load(1, {shade: [0.3,'#fff']});
			$(form).ajaxSubmit({
				dataType:"json",
				success:function( jsondata ){
					layer.closeAll('loading');
					if( jsondata.success){
						toastr.success('保存成功！');
					}else{
						toastr.error(jsondata.msg);
					}
				}
			});
		},
		rules : {
			siteName : {
				required : true
			},
			siteName : {
				required : true
			}
		}, 
		messages : { 
			siteName : { 
				required : "名称不能为空"
			},
			siteName : { 
				required : "名称不能为空"
			}
		}
	});
});
</script>
<% } %>